import java.util.Scanner;

import javax.naming.spi.DirStateFactory.Result;

public class Ji {
	public static double getSum(double a,double b) {
		double sum=a+b;
		System.out.println("两数和："+sum);
		return sum;
	}
   public static double getJian(double a,double b) {
	   double sum=a-b;
		System.out.println("两数差："+sum);
		return sum;
	}
   public static double  getCheng(double a,double b) {
	   double sum=a*b;
		System.out.println("两数积："+sum);
		return sum;
  	}
   public static double getChu(double a,double b) {
	   double sum=a/b;//放外面
    if (b==0) {
		System.out.println("除数不能为零");
	}else {
		System.out.println("两数商："+sum);
	  }
    return sum;//
  	}
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		  System.out.println("请输入第一个数字");
		  double a=sc.nextInt();
		  System.out.println("请输入运输符号");
		  String aString=sc.next();
		  System.out.println("请输入第二个数字");
		  double b=sc.nextInt();
		  double result=0;
		switch (aString) {
		case "+":
			    result = getSum(a,b);
			break;
            case "-":
            	result = getJian(a,b);
            break;
            case "*":
            	result =  getCheng(a,b);
            break;
            case "/":
            	result = getChu(a,b);
            break;
		}
		//System.out.println(result);
	}
}
